package com.ztorn.fiscale.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ztorn.common.core.annotation.Excel;
import com.ztorn.common.core.annotation.Excel.ColumnType;
import com.ztorn.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易记录对象 fiscale_transaction
 *
 * @author ztorn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("fiscale_transaction")
public class FiscaleTransaction extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 交易ID */
    @TableId(type = IdType.AUTO)
    @Excel(name = "交易ID", cellType = ColumnType.NUMERIC)
    private Long transactionId;

    /** 交易编号 */
    @Excel(name = "交易编号")
    private String transactionCode;

    /** 账户ID */
    @Excel(name = "账户ID", cellType = ColumnType.NUMERIC)
    private Long accountId;

    /** 交易类型（1收入 2支出 3转账） */
    @Excel(name = "交易类型", readConverterExp = "1=收入,2=支出,3=转账")
    private String transactionType;

    /** 交易金额 */
    @Excel(name = "交易金额")
    private BigDecimal amount;

    /** 交易日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date transactionDate;

    /** 交易状态（0未核销 1已核销） */
    @Excel(name = "交易状态", readConverterExp = "0=未核销,1=已核销")
    private String transactionStatus;

    /** 对方账户 */
    @Excel(name = "对方账户")
    private String counterparty;

    /** 交易分类ID */
    @Excel(name = "交易分类ID", cellType = ColumnType.NUMERIC)
    private Long categoryId;

    /** 关联业务单号 */
    @Excel(name = "关联业务单号")
    private String businessCode;

    /** 交易描述 */
    @Excel(name = "交易描述")
    private String description;
}
